package net.kangyee.eventmanager.listeners;

import org.bukkit.event.EventHandler;
import org.bukkit.event.Listener;
import org.bukkit.event.player.PlayerJoinEvent;

import net.kangyee.eventmanager.util.MessageManager;

public class ListenPlayerJoin implements Listener {
	
	private String[] newVerInfo;
	
	public ListenPlayerJoin(String[] newVerInfo){
		this.newVerInfo = newVerInfo;
	}

	@EventHandler
	public void onPlayerJoin(PlayerJoinEvent e) {
		if(e.getPlayer().isOp()){
			MessageManager.sendPNormalMessage(e.getPlayer(), "发现新版本:&a" + newVerInfo[0] + "&f,请前往MCBBS插件发布页下载最新版更新噢");
			MessageManager.sendPNormalMessage(e.getPlayer(), "或通过单击这个网址下载:&a" + newVerInfo[1]);
		}
	}
	
}
